﻿<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
  xmlns:sw="clr-namespace:System.Windows;assembly=System.Windows"
  xmlns:c="clr-namespace:HomeUX.Controls;assembly=HomeUX.ClientLibrary"
  xmlns:m="clr-namespace:HomeUX.MusicClientLibrary"
  xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

    <Style TargetType="m:MusicController">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="m:MusicController">
					<ContentControl x:Name="LayoutRoot" IsEnabled="True" IsTabStop="False">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="WaitingStates">
                                <VisualState x:Name="Idle">
                                    <Storyboard>
										<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="IsEnabled">
											<DiscreteObjectKeyFrame KeyTime="0" Value="True" />
										</ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
								</VisualState>
                                <VisualState x:Name="Loading">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.3" Storyboard.TargetName="WaitingShadow" Storyboard.TargetProperty="Opacity" To="1" />
										<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="WaitingTextBlock" Storyboard.TargetProperty="Text">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Accessing music server..." />
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="IsEnabled">
											<DiscreteObjectKeyFrame KeyTime="0" Value="False" />
										</ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MusicServerNotAvailable">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.3" Storyboard.TargetName="WaitingShadow" Storyboard.TargetProperty="Opacity" To="1" />
										<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="WaitingTextBlock" Storyboard.TargetProperty="Text">
											<DiscreteObjectKeyFrame KeyTime="0" Value="The music server is not available" />
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="IsEnabled">
											<DiscreteObjectKeyFrame KeyTime="0" Value="False" />
										</ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
							</VisualStateGroup>
                            <VisualStateGroup x:Name="MediaControlsModeStates">
                                <VisualState x:Name="ShowMediaControls" />
                                <VisualState x:Name="NoMediaControls">
                                    <Storyboard>
										<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="MediaControlsGroup" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
										</ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="AddToQueueModeGroup" Storyboard.TargetProperty="Opacity" To="0" />
										<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NoMediaControlsMessage" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
										</ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="AddToQueue">
                                    <Storyboard>
										<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="MediaControlsGroup" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NoMediaControlsMessage" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="AddToQueueModeGroup" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
										</ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0:0:0.3" Storyboard.TargetName="AddToQueueModeGroup" Storyboard.TargetProperty="Opacity" To="1" />
                                    </Storyboard>
                                </VisualState>
							</VisualStateGroup>
                            <VisualStateGroup x:Name="TrackInfoStates">
                                <VisualState x:Name="ShowTrackInfo" />
                                <VisualState x:Name="HideTrackInfo">
                                    <Storyboard>
										<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="TrackInfoGroup" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
	                    <Grid Width="375" Height="450">
							<c:NoAlbumArtIcon x:Name="NoAlbumArtIcon" HorizontalAlignment="Left" Width="200" Height="200" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment" />
							<Image x:Name="AlbumArtImage" Stretch="Uniform" HorizontalAlignment="Left" Width="200" Height="200" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment" />
							<TextBlock FontSize="13" Text="Artist:" Margin="0,214,0,217" HorizontalAlignment="Left" d:LayoutOverrides="Height" />
				            <TextBlock x:Name="ArtistNameTextBlock" FontSize="13" Text="(None)" Margin="80,214,0,217" HorizontalAlignment="Stretch" d:LayoutOverrides="Height" />
				            <TextBlock FontSize="13" Text="Album:" Margin="0,0,0,198" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
				            <TextBlock x:Name="AlbumNameTextBlock" FontSize="13" Text="(None)" Margin="80,0,0,198" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
				            <Grid x:Name="TrackInfoGroup" Height="56" Margin="0,0,0,142" VerticalAlignment="Bottom">
				            	<TextBlock FontSize="13" Text="Track:" HorizontalAlignment="Left" VerticalAlignment="Top" />
				            	<TextBlock x:Name="TrackNameTextBlock" FontSize="13" Text="(None)" Margin="80,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
				            	<TextBlock FontSize="13" Text="Composer:" Margin="0,18,0,19" HorizontalAlignment="Left" d:LayoutOverrides="Height" />
				            	<TextBlock x:Name="ComposerTextBlock" FontSize="13" Text="(None)" Margin="80,18,0,19" HorizontalAlignment="Stretch" d:LayoutOverrides="Height" />
				            	<TextBlock FontSize="13" Text="Year:" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
				            	<TextBlock x:Name="YearTextBlock" FontSize="13" Text="(None)" Margin="80,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="70" d:LayoutOverrides="HorizontalAlignment" />
				            	<TextBlock x:Name="DurationTextBlock" FontSize="13" Text="[ 0:00 / 0:00 ]" Margin="215,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="135" />
				            </Grid>
							<c:TouchButton x:Name="BrowseArtistsButton" Text="Browse Artists" Width="80" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,80,0" />
				            <c:TouchButton x:Name="SearchButton" Text="Search Music" Margin="295,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="80" FontSize="13" d:LayoutOverrides="VerticalAlignment" />
				            <c:TouchButton x:Name="ViewThisArtistButton" Text="View This Artist" Width="80" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,50,80,0" d:LayoutOverrides="HorizontalAlignment" />
				            <c:TouchButton x:Name="ViewThisAlbumButton" Visibility="Visible" Text="View This Album" Width="80" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,50,0,0" />
				            <c:TouchButton x:Name="ViewNowPlayingAlbumButton" Visibility="Visible" Text="What's Playing?" Width="80" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,50,0,0" />
				            <Grid Height="130" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="375">
								<Grid x:Name="MediaControlsGroup" Visibility="Visible">
					            	<c:TouchButton x:Name="StopButton" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="75" Margin="0,0,0,50">
					            		<c:StopIcon />
					            	</c:TouchButton>
					            	<c:TouchButton x:Name="PreviousTrackButton" Margin="75,0,0,50" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="75">
					            		<c:PreviousTrackIcon />
					            	</c:TouchButton>
					            	<c:TouchButton x:Name="NextTrackButton" Margin="225,0,0,50" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="75">
					            		<c:NextTrackIcon />
					            	</c:TouchButton>
					            	<c:TouchButton  x:Name="PauseButton" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="75">
					            		<c:PauseIcon />
					            	</c:TouchButton>
					            	<c:TouchButton  x:Name="RewindButton" Margin="75,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="75" IsAutoRepeatEnabled="True" >
					            		<c:RewindIcon />
					            	</c:TouchButton>
					            	<c:TouchButton x:Name="PlayButton" Margin="150,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="75">
					            		<c:PlayIcon />
					            	</c:TouchButton>
					            	<c:TouchButton x:Name="FastForwardButton" Margin="225,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="75">
					            		<c:FastForwardIcon />
					            	</c:TouchButton>
								</Grid>
		                        <TextBlock x:Name="NoMediaControlsMessage" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="13" Foreground="#505050" TextAlignment="Center">
									Another album is currently playing.<LineBreak/>
									Press <Run FontWeight="Bold">What's Playing?</Run> to see it.<LineBreak/>
                                    Press a track button to play this album instead.
								</TextBlock>								
		                        <c:Shadow x:Name="AddToQueueModeGroup" Opacity="0" Visibility="Collapsed" Margin="8,0,0,0" ShadowOverhang="8" ShadowDarkness="3" HorizontalAlignment="Center" VerticalAlignment="Center">
		                            <Border Background="White" BorderBrush="Gray" BorderThickness="1">
										<Grid Margin="8">
											<Grid.RowDefinitions>
												<RowDefinition Height="Auto" />
												<RowDefinition Height="Auto" />
											</Grid.RowDefinitions>
											<TextBlock FontSize="13" Margin="0,0,0,8" LineHeight="16" LineStackingStrategy="BlockLineHeight">Select tracks to add to the queue.<LineBreak/>Touch a selected track to remove it from the queue.</TextBlock>
											<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
												<c:TouchButton x:Name="QueueAllTracksButton" Text="Queue All Tracks" Width="80" Margin="0,0,8,0" />
												<c:TouchButton x:Name="ClearQueueButton" Text="Clear Queue" Width="80" Margin="0,0,8,0" />
												<c:TouchButton x:Name="ExitAddToQueueModeButton" Text="Done" Width="80" />
											</StackPanel>
										</Grid>
		                            </Border>
		                        </c:Shadow>
				            </Grid>
				            <TextBlock FontSize="13" Text="Queued Next" TextDecorations="Underline" Margin="215,113,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="160" />
				            <TextBlock x:Name="QueueStateTextBlock" FontSize="13" Text="0 tracks - 0:00" Margin="215,129,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="160" />
				            <c:TouchButton x:Name="ViewQueueButton" Width="80" HorizontalAlignment="Right" Text="View Queue" Margin="0,150,80,0" VerticalAlignment="Top" d:LayoutOverrides="Height" />
	                        <c:TouchButton x:Name="AddToQueueButton" Width="80" HorizontalAlignment="Right" Text="Add to Queue..." Margin="0,150,0,0" VerticalAlignment="Top" d:LayoutOverrides="Height" />
	                        <c:Shadow x:Name="WaitingShadow" Opacity="0" Margin="0,0,0,20" ShadowOverhang="8" ShadowDarkness="3" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False">
	                            <Border Background="White" BorderBrush="Gray" BorderThickness="1">
	                                <TextBlock x:Name="WaitingTextBlock" Margin="20" FontSize="13" LineStackingStrategy="BlockLineHeight" LineHeight="14" />
	                            </Border>
	                        </c:Shadow>
						</Grid>
					</ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="m:AlbumButtonFace">
		<Setter Property="Width" Value="150" />
		<Setter Property="Height" Value="190" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="m:AlbumButtonFace">
                    <Grid x:Name="LayoutRoot">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="140" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <c:NoAlbumArtIcon Grid.Row="0" x:Name="NoAlbumArtIcon" Scale="0.65" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        <Image Grid.Row="0" x:Name="AlbumArtImage" Source="{TemplateBinding AlbumArt}" Width="130" Height="130" />
                        <TextBlock Grid.Row="1" x:Name="AlbumNameTextBlock" Text="{TemplateBinding AlbumName}" FontSize="13" TextAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" LineStackingStrategy="BlockLineHeight" LineHeight="17" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>

